<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <style>
        body{
            font-family:"Microsoft YaHei";
        }
        #tab{
            width: 600px;
            margin: 0 auto;
        }
        .tab-tit{
            font-size: 0;
            width: 600px;
        }
        .tab-tit a{
            display: inline-block;
            height: 40px;
            line-height: 40px;
            font-size: 16px;
            width: 25%;
            text-align: center;
            background: #ccc;
            color: #333;
            text-decoration: none;
        }
        .tab-tit .cur{
            background: #09f;
            color: #fff;
        }
        .tab-con div{
            border: 1px solid #ccc;
            height: 400px;
            padding-top: 20px;
        }
    </style>
</head>
<body>

<div id="tab">
    <div class="tab-tit">
        <a href="javascript:;" @click="curId=0" :class="{'cru':curId===0}">html</a>
        <a href="javascript:;" @click="curId=1" :class="{'cur':curId===1}">css</a>
        <a href="javascript:;" @click="curId=2" :class="{'cur':curId===2}">javascript</a>
        <a href="javascript:;" @click="curId=3" :class="{'cur':curId===3}">vue</a>
    </div>
    <div class="tab-con">
        <div v-show="curId===0">html_content</div>
        <div v-show="curId===1">css_content</div>
        <div v-show="curId===2">javascript_content</div>
        <div v-show="curId===3">vue_content</div>
    </div>
</div>

<script>
    var tab = new Vue({
        data:{
            curId:0
        }
    }).$mount("#tab")
</script>
</body>
</html>
